<%--
  Created by IntelliJ IDEA.
  User: 王德明
  Date: 2018/5/2
  Time: 15:32
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<div class="modal-header">
    <button class="close" ng-click="cancel()">
        <span aria-hidden="true">×</span>
    </button>
    <h3 class="modal-title" id="modal-title">商务卡管理</h3>
</div>

<div class="modal-body" id="modal-body">
    <div class="ibox-content no-borders tab-content">
        <!--添加-->
        <form name="myForm" class="form-horizontal formTopSpacing" ng-model="business" ng-show="type == 0 ">
            <!-- 卡种-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>卡种：</label>
                <div class="col-sm-8">
                    <select id="type" name="type" class="form-control" ng-model="business.payType"
                            ng-blur="typeBlur($event,business.payType)" required>
                        <option value=""></option>
                        <option ng-repeat="x in init.credit" value="{{ x.firstValue }}">
                            {{ x.name }}
                        </option>
                    </select>
                </div>
            </div>
            <!-- 起始卡号-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>起始卡号：</label>
                <div class="col-sm-8">
                    <input id="startnumber" name="startnumber" type="text" class="form-control"
                           ng-model="business.startNo" ng-keyup="startnumberBlur($event,business.startNo)" required>
                </div>
            </div>
            <!--结束卡号-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>结束卡号：</label>
                <div class="col-sm-8">
                    <input  name="finallnumber" type="text" class="form-control"
                           ng-model="business.endNo" ng-keyup="finallnumberBlur($event,business.endNo)" required>
                </div>
            </div>
            <!-- 备注-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle">备注：</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="founder" ng-model="business.remark">
                </div>
            </div>
        </form>
        <!--更新-->
        <form name="myFormupdate" class="form-horizontal formTopSpacing" ng-model="risk" ng-show="type == 1 ">
            <!-- 卡种-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>卡种：</label>
                <div class="col-sm-8">
                    <select  name="typeupdate" class="form-control" ng-model="risk.payType"
                            ng-blur="typeupdateFocus($event,risk.payType)" required>
                        <option ng-repeat="x in init.credit" value="{{ x.firstValue }}">
                            {{ x.name }}
                        </option>
                    </select>
                </div>
            </div>
            <!-- 起始卡号-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>起始卡号：</label>
                <div class="col-sm-8">
                    <input  name="startnumberupdate" type="text" class="form-control"
                           name="founder" ng-model="risk.startNo" ng-keyup="startnumberupdateFocus($event,risk.startNo)"
                           required>
                </div>
            </div>
            <!--结束卡号-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle"><span
                        class="text-danger">*</span>结束卡号：</label>
                <div class="col-sm-8">
                    <input  name="finallnumberupdate" type="text" class="form-control"
                           name="founder" ng-model="risk.endNo" ng-keyup="finallnumberupdateFocus($event,risk.endNo)"
                           required>
                </div>
            </div>
            <!-- 备注-->
            <div class="form-group">
                <label class="col-sm-3 control-label formTextVerticalMiddle">备注：</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="founder" ng-model="risk.remark">
                </div>
            </div>
        </form>
    </div>
</div>

<div class="modal-footer">
    <row>
        <div class="col-sm-12">
            <div class="center">
                <button class="btn btn-sm btn-primary general-btn" type="button"
                        ng-click="insertRiskBusiness(business,0)"
                        ng-disabled=" !myForm.type.$valid || !myForm.startnumber.$valid || !myForm.finallnumber.$valid "
                        ng-show="type == 0">
                    确定
                </button>
                <button class="btn btn-sm btn-primary general-btn" type="button" ng-click="updateRiskBusiness(risk,1)"
                      ng-disabled="nextDisabled(myFormupdate)"  ng-show="type == 1">
                    确定
                </button>
            </div>
        </div>
    </row>
</div>